// graham扫描法求凸包
// https://blog.csdn.net/neau2014/article/details/48225965

#include <stdio.h>
#include <math.h>

#define pi 3.1415926;

//点数最大坐标
const int pointMax=10001; 
const int maxLen=1000;


double jsAngle(int startx,int starty,int endx,int endy){
    double y=(double)(endy-starty);
    int x=endx-startx;
    if(x==0)
    {
        if(y<0)
        {
            return 270;
        }
        else{
            return 90;
        }
    }
    else 
    {
        double angle=atan(y/x)*180/pi;
        if(angle<0)
        {
            angle+=180;
        }
        if(y<0)
        {
            angle+=180;
        }

        return angle;
    }
}

int isDoubleEqual(double a,double b)
{
    double p=a-b;
    if(p<0)
    {
        p=-p;
    }
	if(p<0.00000001f){
        return 1;
	}
    else{
        return 0;
    }
}

float jl(int x1,int y1,int x2,int y2)
{
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}


int main(){
    int t;
    scanf("%d",&t);
    int n;
    int i,k;
    int x[maxLen],y[maxLen];
    int bj[maxLen];
    int jlIndex[maxLen];
    int jl_len=0;
    double jl_angle;
    // int stackx[maxLen],stacky[maxLen];

    for(k=0;k<t;k++)
    {
        scanf("%d",&n);

        

        int nowx=pointMax,nowy=pointMax;
        int startIndex=-1;
        //寻找最左下方的起点
        for(i=0;i<n;i++)
        {
            scanf("%d %d",&x[i],&y[i]);
            bj[i]=0;

            if(y[i]<nowy||(y[i]==nowy&&x[i]<=nowx))
            {
                startIndex=i;
                nowx=x[i];
                nowy=y[i];
            }
        }

        int nowIndex=startIndex;
		bj[startIndex]=1;

        int result=1;
		
		int num_bian=0;
        
        do{
            jl_angle=361;
			jl_len=0;
            for(int i=0;i<n;i++)
            {
                if(i==nowIndex||bj[i]==1)
                {
                    continue;
                }

                double angle=jsAngle(nowx,nowy,x[i],y[i]);

                if(isDoubleEqual(angle,jl_angle))
                {
                    jlIndex[jl_len]=i;
                    jl_len++;
                }
                else if(angle<jl_angle)
                {
                    jl_angle=angle;
                    jlIndex[0]=i;
                    jl_len=1;
                }
                 
            }

            if(jl_len<=1)
            {
                result=0;
                break;
            }
            else{
                int maxx=0;
                for(i=0;i<jl_len;i++)
                {
                    int index=jlIndex[i];
                    bj[index]=1;
                    int cha_x=jl(nowx,nowy,x[index],y[index]);
                    if(cha_x>maxx)
                    {
                        maxx=cha_x;
                        nowIndex=index;
                    }
                }
                nowx=x[nowIndex];
                nowy=y[nowIndex];
            }
			num_bian++;

            //边数超过1了可以使用起始点了
			if(num_bian>1)
			{
				bj[startIndex]=0;
			}
        }while(startIndex!=nowIndex);

        if(result==1)
        {
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }


    }
    // int a,b,c,d;
    // while(scanf("%d %d %d %D",&a,&b,&c,&d)!=EOF)
    // {
    //     double angle=jsAngle(a,b,c,d);
    //     printf("%f\n",angle);
    // }
    return 0;
}